package com.example.JavaConcurrent.Project3_Phaser.awaitAdvanceInterruptibly_2;


import java.util.concurrent.Phaser;

/**
 * awaitAdvance(phase):
 *     如果传入参数phase和getphase相等，则线程在屏蔽处等待，否则向下运行。
 */
public class Run {
    public static void main(String[] args) {
        Phaser phaser = new Phaser();
        ThreadA a = new ThreadA(phaser);
        a.start();

        try {
            Thread.sleep(2000);
            a.interrupt();

            System.out.println("中断");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
